﻿using FileStorageCenter.Services.Models;
using FileInfo = FileStorageCenter.Services.Models.FileInfo;

namespace FileStorageCenter.Services.Services;

public interface IFileInfoService
{
    Task<PageResult<FileInfo.QueryModel>> GetPageAsync(FileInfo.ConditionSelectorCondition condition, CancellationToken cancellationToken);

    Task<OperationalResult> UpdateAsync(int id, FileInfo.UpdateModel fileInfo, CancellationToken cancellationToken);

    Task<OperationalResult> DeleteAsync(int id, CancellationToken cancellationToken);

    ValueTask UploadFileAsync(UploadModel model, CancellationToken cancellationToken = default);

    ValueTask UploadFileRangeAsync(IEnumerable<UploadModel> models, CancellationToken cancellationToken = default);

    ValueTask<OperationalResult<DownloadModel>> DownloadFileAsync(string fileid, CancellationToken cancellationToken = default);

    ValueTask<OperationalResult<bool>> RemoveFileAsync(string fileid);

    Task ChunkStageAsync(ChunkModel model, CancellationToken cancellationToken = default);

    Task ChunkMergeAsync(string identifier, string filename, CancellationToken cancellationToken);

    Task<OperationalResult<bool>> ChunkVerifyAsync(string identifier, string chunkIndex, CancellationToken cancellationToken);

    Task<OperationalResult<IEnumerable<int>>> GetChunkSlicesAsync(string identifier, CancellationToken cancellationToken);
}